package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpContractsChangeRequestsPageUtil extends SeleniumPageUtil {
	public final static By CCR_TD_USER_SELECT			= By.id("ContractChgRequestsDashboard1_tdUserSelect");
	public final static By CCR_INPUT_USER				= By.id("ContractChgRequestsDashboard1_txtUser");
	public final static By CCR_DIV_RESULT_PAGE		= By.xpath("//*[@id='ContractChgRequestsDashboard1_lblPaging']/div");
	public final static By CCR_TD_CONTRACTS			= By.xpath("//*[@id='pnlChgReq']/table/tbody/tr/td[5]");
	public final static By CCR_SPAN_REC_NUM			= By.id("ContractChgRequestsDashboard1_lblNumRecs");
	public final static By CCR_SPAN_SCOPE				= By.id("ContractChgRequestsDashboard1_lblScope");
	public final static By CCR_FILTER_IN_RENEWAL		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[1]/div/img[1]");
	public final static By CCR_FILTER_CUSTOMER		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[2]/div/img[1]");
	public final static By CCR_FILTER_CONTRACT		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[3]/div/img[1]");
	public final static By CCR_LINK_IN_RENEWAL		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[1]/a");
	public final static By CCR_LINK_CUSTOMER			= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[2]/a");
	public final static By CCR_LINK_CONTRACT			= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[3]/a");
	public final static By CCR_LINK_CREATEBY			= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[4]/a");
	public final static By CCR_LINK_SMSIMG				= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[5]/a");
	public final static By CCR_LINK_TOTA					= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[6]/a");
	public final static By CCR_LINK_SMS_ASSETS		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[7]/a");
	public final static By CCR_LINK_CART					= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[8]/a");
	public final static By CCR_LINK_CSR					= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[9]/a");
	public final static By CCR_LINK_SMS_PARTS			= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[10]/a");
	public final static By CCR_LINK_SMS_SUB				= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[11]/a");
	public final static By CCR_LINK_SMS_PRIC			= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[12]/a");
	public final static By CCR_LINK_SMS_CON			= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[13]/a");
	public final static By CCR_LINK_NEED_CUST			= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[14]/a");
	public final static By CCR_LINK_ACTIVE				= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[15]/a");
	public final static By CCR_LINK_DISCREP				= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[16]/a");

	public static void enter(){
		SpContractsChangePageUtil.enterChangesRequests();
		waitForPageToLoad();
	}

	private static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				CCR_INPUT_USER,CCR_LINK_DISCREP,CCR_LINK_IN_RENEWAL
		});
	}
}
